package com.ruoyi.kycinfo.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kycinfo.mapper.KycFamilyMapper;
import com.ruoyi.kycinfo.domain.KycFamily;
import com.ruoyi.kycinfo.service.IKycFamilyService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class KycFamilyServiceImpl implements IKycFamilyService {
    @Autowired
    private KycFamilyMapper kycFamilyMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param familyId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public KycFamily selectKycFamilyByFamilyId(Long familyId) {
        return kycFamilyMapper.selectKycFamilyByFamilyId(familyId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param kycFamily 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<KycFamily> selectKycFamilyList(KycFamily kycFamily) {
        return kycFamilyMapper.selectKycFamilyList(kycFamily);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param kycFamily 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertKycFamily(KycFamily kycFamily) {
        kycFamily.setCreateTime(DateUtils.getNowDate());
        return kycFamilyMapper.insertKycFamily(kycFamily);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param kycFamily 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateKycFamily(KycFamily kycFamily) {
        kycFamily.setUpdateTime(DateUtils.getNowDate());
        return kycFamilyMapper.updateKycFamily(kycFamily);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param familyIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteKycFamilyByFamilyIds(Long[] familyIds) {
        return kycFamilyMapper.deleteKycFamilyByFamilyIds(familyIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param familyId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteKycFamilyByFamilyId(Long familyId) {
        return kycFamilyMapper.deleteKycFamilyByFamilyId(familyId);
    }


    // 根据客户userInfoId删除客户家庭信息
    @Override
    public int deleteKycFamilyByUserInfoId(Long userInfoId) {
        return kycFamilyMapper.deleteKycFamilyByUserInfoId(userInfoId);
    }

    @Override
    public int deleteKycFamilyByUserInfoIds(Long[] userInfoIds) {
        return kycFamilyMapper.deleteKycFamilyByUserInfoIds(userInfoIds);
    }

    @Override
    public List<KycFamily> selectKycFamilyListByUserInfoId(Long userInfoId) {
        KycFamily kycFamily = new KycFamily();
        kycFamily.setUserInfoId(userInfoId);
        return kycFamilyMapper.selectKycFamilyList(kycFamily);
    }


}
